package cn.com.czpb.client.module.news.activity;

import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import cn.com.czpb.client.R;
import cn.com.czpb.client.app.MToolBarActivity;
import butterknife.BindView;

/**
 * Created by admin on 16/10/18.
 */
public class NewsSzbDetailActivity extends MToolBarActivity {
    public final static String SZB_URL = "SZBuRL";
    public final static String SZB_TITLE = "SZBTITLEE";
    private String dataUrl = "http://nj.99cms.com/demo/api.php?s=/News/getNewsInfo/Nid/160/siteid/1";

    @BindView(R.id.szb_wv)
    WebView mWebview;


    private String mUrl;
    private String mTitle;
    private boolean mIsLoadError = false;

    @Override
    protected void onDestroy() {
        if (mWebview != null)
            mWebview.destroy();
        super.onDestroy();
    }

    @Override
    protected int setLayoutId() {
        return R.layout.activity_news_szb_detial;
    }


    @Override
    public void initData() {
        mUrl = getIntent().getStringExtra(SZB_URL);
        mTitle =  getIntent().getStringExtra(SZB_TITLE);
//        getServerList();
    }
    @Override
    public void initView() {
        WebSettings webSettings = mWebview.getSettings();
        webSettings.setSavePassword(false);
        webSettings.setJavaScriptEnabled(true);
        mWebview.addJavascriptInterface(this, "MyApp");
        mWebview.setWebViewClient(new WebViewClient(){
        });
        mWebview.loadUrl(mUrl);

    }
}
